-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
BUG: Series.map with pyarrow timestamp/duration #62278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pandas/core/indexes/datetimes.py
Outdated
import pyarrow as pa | ||
|
||
pa_dtype = dtype.pyarrow_dtype | ||
if not pa.types.is_timestamp(pa_dtype): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not pa.types.is_timestamp(pa_dtype): | |
if dtype.kind != "M": |
Would allow you to avoid the pyarrow import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, will update
pandas/core/indexes/timedeltas.py
Outdated
if isinstance(dtype, ArrowDtype): | ||
import pyarrow as pa | ||
|
||
return pa.types.is_duration(dtype.pyarrow_dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment here
Thanks @jbrockmendel |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.